﻿Public Class OrbAuthFailureException
    Inherits OrbBaseException

    Public Overrides ReadOnly Property Message() As String
        Get
            Dim strMessage As String
            strMessage = "Authentication Failure."

            Return strMessage
        End Get
    End Property

    Public Overrides ReadOnly Property ExtraInfo() As String
        Get
            Return "Please check your username or password." & vbCrLf & "If you're really sure they are correct, please contact the developer of this app. There might be a problem with the API key."
        End Get
    End Property

    Public Overrides ReadOnly Property ShortName() As String
        Get
            Return "ERR0001"
        End Get
    End Property

End Class



Public Class OrbBaseException
    Inherits Exception

    Public Overridable ReadOnly Property ExtraInfo() As String
        Get
            Return "Sorry, but no extra information is available for this error."
        End Get
    End Property

    Public Overridable ReadOnly Property ShortName() As String
        Get
            Return "ERR9999"
        End Get
    End Property
End Class

Public Class OrbFatalException
    Inherits OrbBaseException

    Public Overrides ReadOnly Property Message() As String
        Get
            Dim strMessage As String
            strMessage = "Fatal Exception"

            Return strMessage
        End Get
    End Property

    Public Overrides ReadOnly Property ExtraInfo() As String
        Get
            Return "Please restart the application."
        End Get
    End Property

    Public Overrides ReadOnly Property ShortName() As String
        Get
            Return "ERR0000"
        End Get
    End Property

End Class

Public Class OrbNoApiKeyException
    Inherits OrbBaseException

    Public Overrides ReadOnly Property Message() As String
        Get
            Dim strMessage As String
            strMessage = "No API Key provided"

            Return strMessage
        End Get
    End Property

    Public Overrides ReadOnly Property ExtraInfo() As String
        Get
            Return "Please ask the developer to get an API key."
        End Get
    End Property

    Public Overrides ReadOnly Property ShortName() As String
        Get
            Return "ERR0002"
        End Get
    End Property

End Class

Public Class OrbNoSessionIdFailure
    Inherits OrbBaseException

    Public Overrides ReadOnly Property Message() As String
        Get
            Dim strMessage As String
            strMessage = "None or invalid session id."

            Return strMessage
        End Get
    End Property

    Public Overrides ReadOnly Property ExtraInfo() As String
        Get
            Return "Try to restart the application. If the problem persist, please contact the author."
        End Get
    End Property

    Public Overrides ReadOnly Property ShortName() As String
        Get
            Return "ERR0003"
        End Get
    End Property

End Class

Public Class OrbInternalError
    Inherits OrbBaseException

    Public Overrides ReadOnly Property Message() As String
        Get
            Dim strMessage As String
            strMessage = "Internal error"

            Return strMessage
        End Get
    End Property

    Public Overrides ReadOnly Property ExtraInfo() As String
        Get
            Return "An unknown internal error has occured. Please inform the developer and provide steps to reproduce this problem."
        End Get
    End Property

    Public Overrides ReadOnly Property ShortName() As String
        Get
            Return "ERR0004"
        End Get
    End Property

End Class